operaBool=1;

function schedule(objectID, functionCall)
{
	if (document.getElementById(objectID))
	{
		eval(functionCall);
	}
	else
	{
		setTimeout("schedule('" + objectID + "', '" + functionCall + "')", 2000);
	}
	
	return true;
}

    var URL=location.href;
    var lg = "";
	if (URL.indexOf('../../en/index-2.html') != -1) lg = "en";
	else if (URL.indexOf('../index-3.html') != -1) lg = "fr";
	else if (URL.indexOf('../../de/index-2.html') != -1) lg = "de";
	else if (URL.indexOf('../../es/index-2.html') != -1) lg = "es";
	else if (URL.indexOf('../../en-tbcl/index.html') != -1) lg = "en";
	else if (URL.indexOf('../../fr-tbcl/index.html') != -1) lg = "fr";
	else if (URL.indexOf('../../de-tbcl/index.html') != -1) lg = "de";
	else if (URL.indexOf('../../es-tbcl/index.html') != -1) lg = "es";
	// TBCL //
	else if (langID != null) lg = langID;
	
	if (lg != "en" && lg != "fr" && lg != "de" && lg != "es") lg = "en";
	
function Init(){
	if (is_ie && !is_opera) {
	
		var xml = new ActiveXObject("Microsoft.XMLDOM")
		xml.async = false
		xml.load("/" +lg+ "/new-hp/layout/layout.xml")// Load XSL
		var xsl = new ActiveXObject("Microsoft.XMLDOM")
		xsl.async = false
		xsl.load("/" +lg+ "/new-hp/layout/layout.xsl")// Transform
		document.write(xml.transformNode(xsl));
		//alert("IE");
		
	
	} else if (is_moz) {
			var xslStylesheet;
			var xsltProcessor = new XSLTProcessor();
			var myDOM;
			
			var xmlDoc;
		  // load the xslt file, example1.xsl
		  var myXMLHTTPRequest = new XMLHttpRequest();
		  myXMLHTTPRequest.open("http://www.wow-europe.com/fr/news/GET", "/" +lg+ "/new-hp/layout/layout.xsl", false);
		  myXMLHTTPRequest.send(null);
		
		  xslStylesheet = myXMLHTTPRequest.responseXML;
		  xsltProcessor.importStylesheet(xslStylesheet);
		
		  // load the xml file, example1.xml
		  myXMLHTTPRequest = new XMLHttpRequest();
		  myXMLHTTPRequest.open("http://www.wow-europe.com/fr/news/GET", "/" +lg+ "/new-hp/layout/layout.xml", false);
		  myXMLHTTPRequest.send(null);
		
		  xmlDoc = myXMLHTTPRequest.responseXML;
		
		  var fragment = xsltProcessor.transformToFragment(xmlDoc, document);
		
		  document.getElementById("headerFooter").innerHTML = "";
		
		  myDOM = fragment;
		  document.getElementById("headerFooter").appendChild(fragment);
//		  alert("Firefox");
		  
	} else {

		//alert("Opera");
	
	}

}

		function headerLoad() {
			var obj = document.getElementById("headerFooter");
			obj.innerHTML = document.getElementById('xmlFrame').document.body.innerHTML;		
			var obj3 = document.getElementById("cnt");

		}
		
		function resizeContainer(){
            var obj = document.getElementById("pageContent");
			var obj2 = document.getElementById("cnt");
			var obj3 = document.getElementById("contentTable");
            var padding = 80;
            
			var newHeight = obj3.offsetHeight;
            
            var newWidth = obj3.offsetWidth;

			var oldWidth = obj2.offsetWidth;
            if(newWidth < 662) { newWidth = 662; obj3.style.width = "662px"; }
    		if(is_safari) {obj3.style.position = "relative"; obj3.style.left = "80px"; }

            var diff = padding;
			if(newWidth + padding > oldWidth){
                if (obj) obj.style.width = (newWidth) + "px";
                obj2.style.width = (newWidth+80) + "px";
			} else {
                 obj2.style.width = (newWidth + 80) + "px";
            }
            if (newHeight > 1000) {
				if (location.href.indexOf('../../news/index.html') != -1) {
					if (is_moz) { obj2.style.height = obj3.offsetHeight + "px"; } else { obj2.style.height = obj3.offsetHeight + "px"; }
				} else {
					if (is_moz) { obj2.style.height = obj3.offsetHeight + "px"; } else { obj2.style.height = obj3.offsetHeight + "px"; }
				}
			}
			try {rePosition();}catch(er){}
			try {
				if (toolTipPage) {
						loadTable(); switchClick('alliance','horde');
						levelBracket=5; reloadTable();
				}
			}catch(er){}
		}
		function beforeResize() {
			if (is_opera)
				setTimeout("resizeContainer()", 50);
			else
				resizeContainer();
		}
	
		addEvent(window, 'load', beforeResize);
